<template>
    <div>
      <h3>Count 组件</h3>
      <p>count的值是：{{count}}</p>
      <button @click="add">+1</button>
      <button @click="show">打印this</button>
    </div>
  </template>

<script>
export default {
  props:{
    init:{
      default:10,
      // type:Boolean Invalid prop: type check failed for prop "init". Expected Boolean, got Number with value 15.
    }
  },
  data(){
    return {
      count:this.init ,
    }
  },
  methods:{
    add(){
      this.count ++;
    },
    show(){
      console.log(this);
    }
  }
}
</script>

<style lang="less">
    
</style>